<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src=".//jquery-3.7.1.min.js"></script>
</head>
<body>

    <div>
        <input type="radio" name="user" value="username">
        <span>name</span>
    </div>

    <div>
        <input type="radio" name="user" value="age">
        <span>age</span>
    </div>

    <script>
        //利用属性选择器：选中第一个input,修改对应的span文本：name-->username

        //console.log($("input[value='usename']"));
        //next():找到同级的下一个标签
      
        $('input[value="name"]').next().html("username");
        
    </script>
    
</body>
</html>